package com.library.entity;

import java.io.Serializable;

/**
 * 图书实体类
 */
public class Book implements Serializable {
    private static final long serialVersionUID = 1L;
    
    private int id;             // 图书ID
    private String isbn;        // ISBN号
    private String title;       // 书名
    private String author;      // 作者
    private String publisher;   // 出版社
    private double price;       // 价格
    private int stock;          // 库存数量
    private String category;    // 分类
    private String coverImage;  // 封面图片路径
    
    // 无参构造函数
    public Book() {
    }
    
    // 有参构造函数
    public Book(String isbn, String title, String author, String publisher, 
                double price, int stock, String category, String coverImage) {
        this.isbn = isbn;
        this.title = title;
        this.author = author;
        this.publisher = publisher;
        this.price = price;
        this.stock = stock;
        this.category = category;
        this.coverImage = coverImage;
    }
    
    // Getter和Setter方法
    public int getId() {
        return id;
    }
    
    public void setId(int id) {
        this.id = id;
    }
    
    public String getIsbn() {
        return isbn;
    }
    
    public void setIsbn(String isbn) {
        this.isbn = isbn;
    }
    
    public String getTitle() {
        return title;
    }
    
    public void setTitle(String title) {
        this.title = title;
    }
    
    public String getAuthor() {
        return author;
    }
    
    public void setAuthor(String author) {
        this.author = author;
    }
    
    public String getPublisher() {
        return publisher;
    }
    
    public void setPublisher(String publisher) {
        this.publisher = publisher;
    }
    
    public double getPrice() {
        return price;
    }
    
    public void setPrice(double price) {
        this.price = price;
    }
    
    public int getStock() {
        return stock;
    }
    
    public void setStock(int stock) {
        this.stock = stock;
    }
    
    public String getCategory() {
        return category;
    }
    
    public void setCategory(String category) {
        this.category = category;
    }
    
    public String getCoverImage() {
        return coverImage;
    }
    
    public void setCoverImage(String coverImage) {
        this.coverImage = coverImage;
    }
    
    @Override
    public String toString() {
        return "Book [id=" + id + ", isbn=" + isbn + ", title=" + title + ", author=" + author 
                + ", publisher=" + publisher + ", price=" + price + ", stock=" + stock 
                + ", category=" + category + ", coverImage=" + coverImage + "]";
    }
}
